<script setup lang="ts">
// 无需复杂的数据获取，保持简洁
</script>

<template>
  <div class="home-container">
    <!-- 系统介绍 -->
    <div class="welcome-section">
      <h1>📚 欢迎使用图书管理系统</h1>
      <p class="subtitle">基于现代化技术栈构建的轻量级图书管理解决方案</p>
    </div>

    <!-- 技术栈介绍 -->
    <div class="tech-stack">
      <h2>🛠️ 技术架构</h2>
      <div class="tech-cards">
        <div class="tech-card frontend">
          <div class="tech-icon">🎨</div>
          <h3>前端技术</h3>
          <ul>
            <li><strong>Vue 3</strong> - 渐进式JavaScript框架</li>
            <li><strong>Element Plus</strong> - 基于Vue 3的组件库</li>
            <li><strong>TypeScript</strong> - 类型安全的JavaScript</li>
            <li><strong>Vue Router</strong> - 官方路由管理器</li>
            <li><strong>Pinia</strong> - 轻量级状态管理</li>
          </ul>
        </div>

        <div class="tech-card backend">
          <div class="tech-icon">⚙️</div>
          <h3>后端技术</h3>
          <ul>
            <li><strong>NestJS</strong> - 渐进式Node.js框架</li>
            <li><strong>TypeScript</strong> - 类型安全开发</li>
            <li><strong>JSON存储</strong> - 轻量级数据持久化</li>
            <li><strong>RESTful API</strong> - 标准化接口设计</li>
            <li><strong>装饰器模式</strong> - 优雅的代码组织</li>
          </ul>
        </div>
      </div>
    </div>

    <!-- 系统特点 -->
    <div class="features-section">
      <h2>✨ 系统特点</h2>
      <div class="features-grid">
        <div class="feature-card">
          <div class="feature-icon">🚀</div>
          <h3>轻量级架构</h3>
          <p>无需复杂数据库配置，基于JSON文件存储，部署简单快捷</p>
        </div>

        <div class="feature-card">
          <div class="feature-icon">🎯</div>
          <h3>现代化UI</h3>
          <p>采用Element Plus组件库，界面美观，交互友好</p>
        </div>

        <div class="feature-card">
          <div class="feature-icon">🔧</div>
          <h3>类型安全</h3>
          <p>前后端全栈TypeScript，提供完整的类型检查和智能提示</p>
        </div>

        <div class="feature-card">
          <div class="feature-icon">⚙️</div>
          <h3>开发简便</h3>
          <p>基于现代化框架和工具链，轻松上手，快速构建和扩展，减少开发时间</p>
        </div>
      </div>
    </div>

    <!-- 已实现功能模块 -->
    <div class="modules-section">
      <h2>✅ 已实现功能</h2>
      <div class="modules-grid">
        <div class="module-card implemented">
          <div class="module-header">
            <h3>👤 用户认证系统</h3>
            <span class="status-badge backend">后端实现</span>
          </div>
          <ul>
            <li>用户注册功能</li>
            <li>用户登录验证</li>
            <li>身份认证接口</li>
            <li>用户信息管理</li>
          </ul>
        </div>

        <div class="module-card implemented">
          <div class="module-header">
            <h3>📖 图书管理系统</h3>
            <span class="status-badge backend">后端实现</span>
          </div>
          <ul>
            <li>新增图书信息</li>
            <li>删除图书记录</li>
            <li>修改图书详情</li>
            <li>查询图书列表</li>
          </ul>
        </div>

        <div class="module-card implemented">
          <div class="module-header">
            <h3>🛡️ 安全退出机制</h3>
            <span class="status-badge frontend">前端实现</span>
          </div>
          <ul>
            <li>路由守卫保护</li>
            <li>登录状态检查</li>
            <li>自动登出处理</li>
            <li>状态清理机制</li>
          </ul>
        </div>
      </div>
    </div>

    <!-- 技术实现亮点 -->
    <div class="highlights-section">
      <h2>🌟 技术亮点</h2>
      <div class="highlights-grid">
        <div class="highlight-card">
          <div class="highlight-icon">🔐</div>
          <h3>前后端分离认证</h3>
          <p>后端提供登录注册API，前端通过路由守卫实现权限控制</p>
        </div>

        <div class="highlight-card">
          <div class="highlight-icon">💾</div>
          <h3>JSON文件存储</h3>
          <p>使用JSON文件作为数据存储，轻量级且易于维护和部署</p>
        </div>

        <div class="highlight-card">
          <div class="highlight-icon">🔄</div>
          <h3>RESTful API设计</h3>
          <p>标准化的CRUD操作接口，支持图书管理的完整生命周期</p>
        </div>

        <div class="highlight-card">
          <div class="highlight-icon">⚡</div>
          <h3>响应式状态管理</h3>
          <p>基于Pinia的状态管理，配合Vue3响应式系统实现数据同步</p>
        </div>
      </div>
    </div>

    <!-- 架构说明 -->
    <div class="architecture-section">
      <h2>🏗️ 系统架构</h2>
      <div class="architecture-card">
        <div class="arch-layer frontend-layer">
          <h4>前端层 (Vue3 + Element Plus)</h4>
          <p>• 用户界面渲染与交互<br>• 路由守卫权限控制<br>• 状态管理与数据绑定</p>
        </div>
        <div class="arch-arrow">⬇️</div>
        <div class="arch-layer api-layer">
          <h4>API层 (RESTful接口)</h4>
          <p>• 用户认证接口 (/auth)<br>• 图书管理接口 (/books)<br>• 数据验证与处理</p>
        </div>
        <div class="arch-arrow">⬇️</div>
        <div class="arch-layer backend-layer">
          <h4>后端层 (NestJS)</h4>
          <p>• 业务逻辑处理<br>• 数据操作服务<br>• JSON文件读写管理</p>
        </div>
        <div class="arch-arrow">⬇️</div>
        <div class="arch-layer storage-layer">
          <h4>存储层 (JSON文件)</h4>
          <p>• users.json - 用户数据<br>• books.json - 图书数据<br>• 轻量级文件存储</p>
        </div>
      </div>
    </div>

    <!-- 开发者信息 -->
    <div class="developer-section">
      <p class="powered-by">
        <span class="heart">❤️</span>
        Developed by <strong>8cmcy8</strong>
        <span class="tech-badge">Vue3 + NestJS</span>
        <span class="date-badge">2025.07</span>
      </p>
    </div>
  </div>
</template>

<style scoped>
.home-container {
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* 欢迎部分 */
.welcome-section {
  text-align: center;
  margin-bottom: 40px;
}

.welcome-section h1 {
  font-size: 32px;
  color: #303133;
  margin-bottom: 10px;
  font-weight: 600;
}

.subtitle {
  font-size: 18px;
  color: #606266;
  margin-bottom: 0;
}

/* 技术栈部分 */
.tech-stack {
  margin-bottom: 40px;
}

.tech-stack h2 {
  text-align: center;
  font-size: 24px;
  color: #303133;
  margin-bottom: 30px;
}

.tech-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-bottom: 20px;
}

.tech-card {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.tech-card.frontend {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.tech-card.backend {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
}

.tech-icon {
  font-size: 48px;
  text-align: center;
  margin-bottom: 15px;
}

.tech-card h3 {
  text-align: center;
  margin-bottom: 20px;
  font-size: 20px;
}

.tech-card ul {
  list-style: none;
  padding: 0;
}

.tech-card li {
  margin-bottom: 8px;
  padding-left: 20px;
  position: relative;
}

.tech-card li::before {
  content: '▶';
  position: absolute;
  left: 0;
  color: rgba(255, 255, 255, 0.7);
}

/* 特点部分 */
.features-section {
  margin-bottom: 40px;
}

.features-section h2 {
  text-align: center;
  font-size: 24px;
  color: #303133;
  margin-bottom: 30px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.feature-card {
  background: white;
  padding: 25px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  text-align: center;
  transition: transform 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-5px);
}

.feature-icon {
  font-size: 36px;
  margin-bottom: 15px;
}

.feature-card h3 {
  color: #303133;
  margin-bottom: 10px;
}

.feature-card p {
  color: #606266;
  line-height: 1.6;
}

/* 已实现功能模块 */
.modules-section {
  margin-bottom: 40px;
}

.modules-section h2 {
  text-align: center;
  font-size: 24px;
  color: #303133;
  margin-bottom: 30px;
}

.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 25px;
}

.module-card {
  background: white;
  padding: 25px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.module-card.implemented {
  border-left: 4px solid #67c23a;
}

.module-card:hover {
  transform: translateY(-3px);
}

.module-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.module-header h3 {
  color: #303133;
  margin: 0;
  font-size: 18px;
}

.status-badge {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.status-badge.backend {
  background: linear-gradient(135deg, #f093fb, #f5576c);
  color: white;
}

.status-badge.frontend {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
}

.module-card ul {
  list-style: none;
  padding: 0;
}

.module-card li {
  color: #606266;
  margin-bottom: 8px;
  padding-left: 20px;
  position: relative;
}

.module-card li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #67c23a;
  font-weight: bold;
}

/* 技术亮点部分 */
.highlights-section {
  margin-bottom: 40px;
}

.highlights-section h2 {
  text-align: center;
  font-size: 24px;
  color: #303133;
  margin-bottom: 30px;
}

.highlights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.highlight-card {
  background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
  padding: 25px;
  border-radius: 10px;
  text-align: center;
  transition: transform 0.3s ease;
}

.highlight-card:hover {
  transform: scale(1.02);
}

.highlight-icon {
  font-size: 36px;
  margin-bottom: 15px;
}

.highlight-card h3 {
  color: #303133;
  margin-bottom: 10px;
}

.highlight-card p {
  color: #606266;
  line-height: 1.6;
}

/* 架构说明部分 */
.architecture-section {
  margin-bottom: 40px;
}

.architecture-section h2 {
  text-align: center;
  font-size: 24px;
  color: #303133;
  margin-bottom: 30px;
}

.architecture-card {
  background: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.arch-layer {
  padding: 20px;
  margin: 10px 0;
  border-radius: 8px;
  text-align: center;
}

.frontend-layer {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
}

.api-layer {
  background: linear-gradient(135deg, #ffecd2, #fcb69f);
}

.backend-layer {
  background: linear-gradient(135deg, #f093fb, #f5576c);
  color: white;
}

.storage-layer {
  background: linear-gradient(135deg, #a8edea, #fed6e3);
}

.arch-layer h4 {
  margin: 0 0 10px 0;
  font-size: 16px;
}

.arch-layer p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

.arch-arrow {
  text-align: center;
  font-size: 24px;
  margin: 5px 0;
}

/* 开发者信息 */
.developer-section {
  text-align: center;
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid #e4e7ed;
}

.powered-by {
  color: #909399;
  font-size: 16px;
}

.heart {
  color: #f56c6c;
  animation: heartbeat 1.5s ease-in-out infinite;
}

.tech-badge {
  background: linear-gradient(135deg, #409eff, #67c23a);
  color: white;
  padding: 4px 12px;
  border-radius: 15px;
  font-size: 12px;
  margin-left: 10px;
}

.date-badge {
  background: linear-gradient(135deg, #e6a23c, #f56c6c);
  color: white;
  padding: 4px 12px;
  border-radius: 15px;
  font-size: 12px;
  margin-left: 10px;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* 响应式设计 */
@media (max-width: 768px) {
  .tech-cards {
    grid-template-columns: 1fr;
  }

  .welcome-section h1 {
    font-size: 24px;
  }

  .subtitle {
    font-size: 16px;
  }

  .module-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}
</style>